<template>
  <view>
    <view class="content">
      <page-head :title="title"></page-head>
      <view class="uni-padding-wrap">
        <view class="uni-title uni-common-mt">
          数组类型
          <text>\n nodes 属性为array</text>
        </view>
        <view class="uni-common-mt" style="background: #fff; padding: 20rpx">
          <rich-text :nodes="nodes"></rich-text>
        </view>
        <view class="uni-title uni-common-mt">
          字符串类型
          <text>\n nodes属性为string</text>
        </view>
        <view class="uni-common-mt" style="background: #fff; padding: 20rpx">
          <rich-text :nodes="strings"></rich-text>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        nodes: [
          {
            name: "div",
            attrs: {
              class: "div-class",
              style: "line-height: 60px; color: red; text-align: center;",
            },
            children: [
              {
                type: "text",
                text: "hello &nbsp; uni-app",
              },
            ],
          },
        ],
        strings:
          '<div style="text-align: center; height: 40px; width: 200px;">nodes是strings-div</div>',
      };
    },
    methods: {},
  };
</script>

<style></style>
